package com.yxjwzpx.management.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yxjwzpx.management.mapper.ShipTypeMapper;
import com.yxjwzpx.management.domain.ShipType;
import com.yxjwzpx.management.service.IShipTypeService;

/**
 * 船舶类型Service业务层处理
 * 
 * @author yxjwzpx
 * @date 2025-04-08
 */
@Service
public class ShipTypeServiceImpl implements IShipTypeService 
{
    @Autowired
    private ShipTypeMapper shipTypeMapper;

    /**
     * 查询船舶类型
     * 
     * @param typeId 船舶类型主键
     * @return 船舶类型
     */
    @Override
    public ShipType selectShipTypeByTypeId(Long typeId)
    {
        return shipTypeMapper.selectShipTypeByTypeId(typeId);
    }

    /**
     * 查询船舶类型列表
     * 
     * @param shipType 船舶类型
     * @return 船舶类型
     */
    @Override
    public List<ShipType> selectShipTypeList(ShipType shipType)
    {
        return shipTypeMapper.selectShipTypeList(shipType);
    }

    /**
     * 新增船舶类型
     * 
     * @param shipType 船舶类型
     * @return 结果
     */
    @Override
    public int insertShipType(ShipType shipType)
    {
        shipType.setCreateTime(DateUtils.getNowDate());
        return shipTypeMapper.insertShipType(shipType);
    }

    /**
     * 修改船舶类型
     * 
     * @param shipType 船舶类型
     * @return 结果
     */
    @Override
    public int updateShipType(ShipType shipType)
    {
        shipType.setUpdateTime(DateUtils.getNowDate());
        return shipTypeMapper.updateShipType(shipType);
    }

    /**
     * 批量删除船舶类型
     * 
     * @param typeIds 需要删除的船舶类型主键
     * @return 结果
     */
    @Override
    public int deleteShipTypeByTypeIds(Long[] typeIds)
    {
        return shipTypeMapper.deleteShipTypeByTypeIds(typeIds);
    }

    /**
     * 删除船舶类型信息
     * 
     * @param typeId 船舶类型主键
     * @return 结果
     */
    @Override
    public int deleteShipTypeByTypeId(Long typeId)
    {
        return shipTypeMapper.deleteShipTypeByTypeId(typeId);
    }
}
